# 最终中配视频
import ffmpeg

# 设置文件路径
input_file = 'I Bought a $300 Gaming PC on TaoBao [8EXrxGByJJg].mp4'
silent_video = 'silent_video.mp4'
audio = 'ch.wav'
output_video = 'audio_added.mp4'

# 提取无声视频
ffmpeg.input(input_file).output(silent_video, an=None).run()

# 将音频添加到无声视频中
ffmpeg.input(silent_video).output(ffmpeg.input(audio), output_video, vcodec='copy', acodec='aac', shortest=None).run()

print("音频添加完成，输出文件为：", output_video)
